package ru.stepuk.modern.nodes;

import javax.swing.ImageIcon;
import javax.swing.JDialog;
import ru.stepuk.modern.InvalidModelException;
import ru.stepuk.modern.Model;
import ru.stepuk.modern.Request;

/**
 *
 * @author ivan
 */
public class Exit extends Node {

    {
        icon = new ImageIcon(getClass().getResource("/images/o_end.png"));
    }

    private Node next;

    public Exit(Model model) {
        super(model);
    }

    @Override
    public void processRequest(Request request) {
        //TODO statistics
        request = null;
    }

    @Override
    public JDialog getPropertiesDialog() {
        return null;
    }

    @Override
    public void validate() throws InvalidModelException {
        if (!model.getOutcome(this).isEmpty()) {
            throw new InvalidModelException(this.name + ": Outcome from exit");
        }
    }

}
